//
//  UserTool.m
//  CC
//
//  Created by Calvin on 5/25/15.
//  Copyright (c) 2015 Calvin. All rights reserved.
//

#import "UserTool.h"
#import "HttpTool.h"
#import "MJExtension.h"
#import "UserInfoResult.h"
#import "UserInfoParam.h"
#import "UnReadCountResult.h"

@implementation UserTool
+(void)userInfoWithParam:(UserInfoParam *)param success:(void (^)(UserInfoResult *result))success failure:(void (^)(NSError *error))failure
{
//    NSDictionary *params = param.keyValues;
//    [HttpTool get:@"https://api.weibo.com/2/users/show.json" params:params success:^(id responseObj) {
//        if (success) {
//            UserInfoResult *result = [UserInfoResult objectWithKeyValues:responseObj];
//            success(result);
//        }
//    } failure:^(NSError *error) {
//        if (failure) {
//            failure(error);
//        }
//    }];
    [self getWithUrl:@"https://api.weibo.com/2/users/show.json" param:param resultClass:[UserInfoResult class] success:success failure:failure];
}

+(void)unreadCountWithParam:(UnReadCountParam *)param success:(void (^)(UnReadCountResult *))success failure:(void (^)(NSError *))failure
{
    [self getWithUrl:@"https://rm.api.weibo.com/2/remind/unread_count.json" param:param resultClass:[UnReadCountResult class] success:success failure:failure];
}
@end
